package com.ruoyi.novel.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.novel.mapper.InvitationMapper;
import com.ruoyi.novel.domain.Invitation;
import com.ruoyi.novel.service.IInvitationService;

/**
 * 邀请链接Service业务层处理
 *
 * @author å¼ ä¸
 * @date 2025-06-12
 */
@Service
public class InvitationServiceImpl extends ServiceImpl<InvitationMapper, Invitation> implements IInvitationService
{
    @Autowired
    private InvitationMapper invitationMapper;

    /**
     * 查询邀请链接
     *
     * @param id 邀请链接主键
     * @return 邀请链接
     */
    @Override
    public Invitation selectInvitationById(Integer id)
    {
        return invitationMapper.selectInvitationById(id);
    }

    /**
     * 查询邀请链接列表
     *
     * @param invitation 邀请链接
     * @return 邀请链接
     */
    @Override
    public List<Invitation> selectInvitationList(Invitation invitation)
    {
        return invitationMapper.selectInvitationList(invitation);
    }

    /**
     * 新增邀请链接
     *
     * @param invitation 邀请链接
     * @return 结果
     */
    @Override
    public int insertInvitation(Invitation invitation)
    {
        invitation.setCreateTime(DateUtils.getNowDate());
        return invitationMapper.insertInvitation(invitation);
    }

    /**
     * 修改邀请链接
     *
     * @param invitation 邀请链接
     * @return 结果
     */
    @Override
    public int updateInvitation(Invitation invitation)
    {
        invitation.setUpdateTime(DateUtils.getNowDate());
        return invitationMapper.updateInvitation(invitation);
    }

    /**
     * 批量删除邀请链接
     *
     * @param ids 需要删除的邀请链接主键
     * @return 结果
     */
    @Override
    public int deleteInvitationByIds(Integer[] ids)
    {
        return invitationMapper.deleteInvitationByIds(ids);
    }

    /**
     * 删除邀请链接信息
     *
     * @param id 邀请链接主键
     * @return 结果
     */
    @Override
    public int deleteInvitationById(Integer id)
    {
        return invitationMapper.deleteInvitationById(id);
    }
}
